from django.contrib import admin

# Register your models here.
from .models import danweibiao, zhiweibiao, renyuanbiao
from import_export.admin import ImportExportModelAdmin

class  ChoiceInline(admin.TabularInline):
	model = zhiweibiao
	extra = 0 

@admin.register(danweibiao)
class danweibiaoAdmin(ImportExportModelAdmin):
	fieldsets = [
	(None, {'fields':['xuhao','quancheng','jiancheng']}),
	('详细信息', {'fields': ['xitong','zhishu','zhengzhishu','fuzhishu','banzishu'], 'classes':['collapse']}),
		]
	inlines = [ChoiceInline]
	list_display = ('quancheng', 'banzishu',)
	list_filter = ['xitong']
	search_fields = ['quancheng']
	ordering = ['xuhao']

@admin.register(zhiweibiao)
class zhiweibiaoAdmin(ImportExportModelAdmin):
	list_display = ['zhiwu','jiancheng','xingming']
	ordering = ['jiancheng','xuhao']
	search_fields = ['zhiwu']
	list_filter = ['jiancheng']

@admin.register(renyuanbiao)
class renyuanbiaoAdmin(ImportExportModelAdmin):
	fields = ['xingming','shenfenzhenghao', 'zhao_pian']
	list_display = ['xingming','shenfenzhenghao']
	inlines = [ChoiceInline]
	search_fields = ['xingming']
	pass

